<%--

    Copyright (C) 2008-2009 Cristian Olaru <colaru@gmail.com>
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
            http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

--%>

<%@ include file="/common/taglibs.jsp"%>
<head>
    <title><fmt:bundle basename="ApplicationResources"><fmt:message key="main.content.title"/></fmt:bundle></title>
</head>

<c:forEach var="article" items="${articles}" varStatus="rowCounter">
<c:if test="${rowCounter.index==1}">
	<div class="adsTowerWrap">
		<br/>
		<div class="adsTower">
			<script type="text/javascript"><!--
			google_ad_client = "pub-8347243412331156";
			/* 120x600, created 1/7/09 */
			google_ad_slot = "7723470406";
			google_ad_width = 120;
			google_ad_height = 600;
			//-->
			</script>
			<script type="text/javascript"
			src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
			</script>
		</div>
	</div>
</c:if>

<c:set var="articleContent">
	<authz:authorize ifAnyGranted="ROLE_ANONYMOUS">
		content_${article.titleLine}_${article.id}_${application_theme}.xhtml
	</authz:authorize>
	<authz:authorize ifAnyGranted="ROLE_USER, ROLE_ADMIN">
		getArticleContent${application_theme}.html?id=${article.id}
	</authz:authorize>
</c:set>

<div id="left">
	<h2><a href="<c:out value="${articleContent}"/>" title="${article.title}">${article.title}</a></h2>	
	<p class="date"><span><fmt:formatDate type="both" dateStyle="short" timeStyle="short" value="${article.date}" pattern="dd"/></span><br /><fmt:formatDate type="both" dateStyle="short" timeStyle="short" value="${article.date}" pattern="MMMMM"/></p>
	<p class="subtitlewithicon"><img align="top" src="<c:url value="${article.type.urlmin}"/>" title="${article.type.name}"/> <fmt:bundle basename="ApplicationResources"><fmt:message key="article.published.by"><fmt:param>${article.nickname}</fmt:param></fmt:message></fmt:bundle></p>
	${article.overview}
	<p> <a class="more" href="<c:out value="${articleContent}"/>"><fmt:bundle basename="ApplicationResources"><fmt:message key="article.read.more"/></fmt:bundle></a> 
		<c:if test="${article.commentsNumber!=0}">
			<a class="more" href="<c:out value="${articleContent}"/>#comments"><fmt:bundle basename="ApplicationResources"><fmt:message key="article.comments"/></fmt:bundle> [${article.commentsNumber}]</a> 
		</c:if>
		<c:if test="${article.ratingsNumber!=0}">
			<a class="more" href="<c:out value="${articleContent}"/>#voting"><fmt:bundle basename="ApplicationResources"><fmt:message key="article.votes"/></fmt:bundle> [<fmt:formatNumber maxFractionDigits="2" value="${article.ratingsNumber}"/>]</a> 
		</c:if>
		<c:if test="${article.mediasNumber!=0}">
			<a class="more" href="<c:out value="${articleContent}"/>#media"><fmt:bundle basename="ApplicationResources"><fmt:message key="article.media"/></fmt:bundle>[${article.mediasNumber}]</a>
		</c:if>
    </p>
</div>
</c:forEach>

<c:if test="${articlesTitlesSize>0}">
<div id="left">
	<h2><a href="#old"><fmt:bundle basename="ApplicationResources"><fmt:message key="article.old.entries"/></fmt:bundle></a></h2>
	<div id="rl">
		<ul>
				<li> 
                  <a>
                  	<cache:cache scope="application" time="-1" groups="tag_cache" key="banner" >
						<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="486" height="60">
						  <param name="movie" value="http://www.javaromania.com/mengine/images/javaromania.swf" />
						  <param name="quality" value="high" />
						  <param name="allowScriptAccess" value="always" />
						     <embed src="http://www.javaromania.com/mengine/banner/javaromania.swf"
						      quality="high"
						      type="application/x-shockwave-flash"
						      width="486"
						      height="60"
						      pluginspage="http://www.macromedia.com/go/getflashplayer"
						      allowScriptAccess="always" />
						</object>
					</cache:cache>
				   </a>
				</li>
			<c:forEach var="article" items="${articlesTitles}" varStatus="rowCounter">
				<c:set var="articleContent">
					<authz:authorize ifAnyGranted="ROLE_ANONYMOUS">
						content_${article.titleLine}_${article.id}_${application_theme}.xhtml
					</authz:authorize>
					<authz:authorize ifAnyGranted="ROLE_USER, ROLE_ADMIN">
						getArticleContent${application_theme}.html?id=${article.id}
					</authz:authorize>
				</c:set>
				<li><a href="<c:out value="${articleContent}"/>" title="${article.title}">${article.title}</a>,  <fmt:formatDate type="both" dateStyle="short" timeStyle="short" value="${article.date}" pattern="dd MMMMM"/>, ${article.category.name} 
				<c:if test="${article.commentsNumber==1}">, ${article.commentsNumber} <fmt:bundle basename="ApplicationResources"><fmt:message key="article.old.entries.comment"/></fmt:bundle> </c:if> 
				<c:if test="${article.commentsNumber>1}">, ${article.commentsNumber} <fmt:bundle basename="ApplicationResources"><fmt:message key="article.old.entries.comments"/></fmt:bundle> </c:if>
				</li>
			</c:forEach>
				<li>
					<a href="http://billing.4java.ca/aff.php?aff=009" title="4Java.ca - JSP Hosting, Servlet Hosting, J2EE Hostin">
						<cache:cache scope="application" time="-1" groups="tag_cache" key="hosting" >
							<img src="http://4java.ca/img/4java_banner_486x60_1.jpg" alt="4Java.ca - JSP Hosting, Servlet Hosting, J2EE Hosting" />
						</cache:cache>
					</a>
				</li>
		</ul>
	</div>
</div>
</c:if>

<a id="old" name="old"></a>